using ObjFileLoader.Data.DataStore;
using ObjFileLoader.TypeParsers.Interfaces;

namespace ObjFileLoader.TypeParsers
{
	public class UseMaterialParser : TypeParserBase, IUseMaterialParser, ITypeParser
	{
		private readonly IElementGroup _elementGroup;

		protected override string Keyword => "usemtl";

		public UseMaterialParser(IElementGroup elementGroup)
		{
			_elementGroup = elementGroup;
		}

		public override void Parse(string line)
		{
			_elementGroup.SetMaterial(line);
		}
	}
}
